import request from '../index';

const alarmUrl = '/alarm-server';

// 终端充电告警记录列表
export const URL_GETCHARGEALARMPAGE = `${alarmUrl}/chargeAlarm/getChargeAlarmPage`;
export const getChargeAlarmPage = (params : any, pages : any) => {
	return request({
		url: `${alarmUrl}/chargeAlarm/getChargeAlarmPage`,
		params: { form: params, pages: pages },
	});
};

// 终端充电告警记录导出
export const EXPORT_CHARGEALARMPAGE = `${alarmUrl}/chargeAlarm/exportChargeAlarm`;

// 电桩离线告警记录列表
export const URL_GETOFFLINEALARMPAGE = `${alarmUrl}/safetyAlarm/getOfflineAlarmPage`;
export const getOfflineAlarmPage = (params : any, pages : any) => {
	return request({
		url: `${alarmUrl}/safetyAlarm/getOfflineAlarmPage`,
		params: { form: params, pages: pages },
	});
};

// 电桩离线告警记录导出
export const EXPORT_OFFLINEALARMPAGE = `${alarmUrl}/safetyAlarm/exportOfflineAlarm`;

// 电桩故障告警记录列表
export const URL_GETFAULTPAGE = `${alarmUrl}/safetyAlarm/getFaultAlarmPage`;
export const getFaultAlarmPage = (params : any, pages : any) => {
	return request({
		url: `${alarmUrl}/safetyAlarm/getFaultAlarmPage`,
		params: { form: params, pages: pages },
	});
};

// 电桩故障告警记录列表导出
export const EXPORT_FAULTPAGE = `${alarmUrl}/safetyAlarm/exportFaultAlarm`;

// 车辆告警记录列表
export const URL_GETVEHICLEALARMPAGE = `${alarmUrl}/chargeAlarm/getVehicleAlarmPage`;
export const getVehicleAlarmPage = (params : any, pages : any) => {
	return request({
		url: `${alarmUrl}/chargeAlarm/getVehicleAlarmPage`,
		params: { form: params, pages: pages },
	});
};

// 车辆告警记录列表导出
export const EXPORT_VEHICLEALARM = `${alarmUrl}/chargeAlarm/exportVehicleAlarm`;


// 账户告警记录列表
export const URL_GETACOUNTALARMPAGE = `${alarmUrl}/accountAlarm/getAccountAlarmPage`;
export const getAccountAlarmPage = (params : any, pages : any) => {
	return request({
		url: `${alarmUrl}/accountAlarm/getAccountAlarmPage`,
		params: { form: params, pages: pages },
	});
};

// 账户告警记录导出
export const EXPORT_ACOUNTALARMPAGE = `${alarmUrl}/accountAlarm/exportAccountAlarm`;


// 异常停充告警列表
export const URL_GETGETSTOPALARMPAGE = `${alarmUrl}/operationAlarm/getStopAlarmPage`;
export const getStopAlarmPage = (params : any, pages : any) => {
	return request({
		url: `${alarmUrl}/operationAlarm/getStopAlarmPage`,
		params: { form: params, pages: pages },
	});
};

// 异常停充告警导出
export const EXPORT_GETSTOPALARMPAGE = `${alarmUrl}/operationAlarm/exportStopAlarm`;

// 连续启动失败告警列表
export const URL_GETCHARGEGFAILPAGE = `${alarmUrl}/operationAlarm/getChargeFailAlarmPage`;
export const getChargeFailAlarmPage = (params : any, pages : any) => {
	return request({
		url: `${alarmUrl}/operationAlarm/getChargeFailAlarmPage`,
		params: { form: params, pages: pages },
	});
};

// 连续启动失败告警导出
export const EXPORT_GETCHARGEGFAILPAG = `${alarmUrl}/operationAlarm/exportChargeFailAlarm`;


// 分页查询告警设置
export const URL_GETPAGEALAERMSETTING = `${alarmUrl}/alarmSetting/getPageAlarmSetting`;

export const getPageAlarmSetting = (params : any, pages : any) => {
	return request({
		url: `${alarmUrl}/alarmSetting/getPageAlarmSetting`,
		params: { form: params, pages: pages },
	});
};

// 保存告警设置
export const saveAlarmSetting = (params : any) => {
	return request({
		url: `${alarmUrl}/alarmSetting/save`,
		params: { form: params, successMsg: '1' },
	});
};

// 更新告警设置
export const updateAlarmSetting = (params : any) => {
	return request({
		url: `${alarmUrl}/alarmSetting/update`,
		params: { form: params, successMsg: '1' },
	});
};

// 删除告警设置
export const deleteAlarmSetting = (params : any) => {
	return request({
		url: `${alarmUrl}/alarmSetting/delete`,
		params: { form: params, successMsg: '2' },
	});
};

// 告警中心详情
export const getAlarmSet = (params : any) => {
	return request({
		url: `${alarmUrl}/alarmSetting/getAlarmSet`,
		params: { form: params },
	});
};

// 告警通知记录
export const URL_GETALARMMESSAGEPAGE = `${alarmUrl}/alarm/getAlarmMessagePage`;
export const getAlarmMessagePage = (params : any, pages : any) => {
	return request({
		url: `${alarmUrl}/alarm/getAlarmMessagePage`,
		params: { form: params, pages: pages },
	});
};

// 告警通知记录导出
export const EXPORT_ALARMMESSAGE = `${alarmUrl}/alarm/exportAlarmMessage`;


// 连续停充警告记录
export const URL_ALARMORDER = `${alarmUrl}/alarmOrder/page`;
export const getAlarmOrder = (params : any, pages : any) => {
	return request({
		url: `${alarmUrl}/alarmOrder/page`,
		params: { form: params, pages: pages },
	});
};
// 连续停充警告导出
export const EXPORT_ALARMORDER = `${alarmUrl}/alarmOrder/export`;


// 离线故障次数
export const URL_ALARMOFFLINE = `${alarmUrl}/offlineFaultAlarm/page`;
export const getOfflineFaultAlarm = (params : any, pages : any) => {
	return request({
		url: `${alarmUrl}/offlineFaultAlarm/page`,
		params: { form: params, pages: pages },
	});
};
// 离线故障次数导出
export const EXPORT_ALARMOFFLIN = `${alarmUrl}/offlineFaultAlarm/export`;


// 故障管理
export const URL_LAILURELIST = `${alarmUrl}/failureInfo/page`;
// 新增故障
export const addFailureInfo = (params : any) => {
	return request({
		url: `${alarmUrl}/failureInfo/add`,
		params: { form: params, successMsg: '1' },
	});
};
// 更新故障信息
export const updateFailureInfo = (params : any) => {
	return request({
		url: `${alarmUrl}/failureInfo/edit`,
		params: { form: params, successMsg: '1' },
	});
};
// 删除故障
export const deleteFailureInfo = (params : any) => {
	return request({
		url: `${alarmUrl}/failureInfo/delete`,
		params: { form: params, successMsg: '2' },
	});
};
// 获取故障信息
export const queryFailureInfo = (params : any) => {
	return request({
		url: `${alarmUrl}/failureInfo/getById`,
		params: { form: params },
	});
};


// 实时故障列表
export const URL_REALFAILURELIST = `${alarmUrl}/connectorFailure/page`;
// 实时故障导出
export const EXPORT_REALFAILURE = `${alarmUrl}/connectorFailure/export`;

// 历史故障列表
export const URL_HISTORYFAILURELIST = `${alarmUrl}/connectorFailureRe/page`;
// 历史故障导出
export const EXPORT_HISTORYFAILURE = `${alarmUrl}/connectorFailureRe/export`;
